# include <cstdio>
# include <iostream>
using namespace std;
int n, m, a;
long long f[10003];
int main() { 
    scanf("%d %d", &m, &n);
    f[0] = 1;
    for(int i = 1; i <= m; i++) { 
        scanf("%d", &a);
        for(int j = a; j <= n; j++) { 
            f[j] += f[j - a];
        }
    }
    printf("%lld\n", f[n]);
}
